/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import java.awt.Component;
import gui.khuyenmai.QuanLyCacChuongTrinhKhuyenMai;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.io.IOException;
import java.io.InputStream;
import pojo.Nhanvien;
import java.net.URL;
import java.beans.PropertyVetoException;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import net.sf.jasperreports.engine.*;

/**
 *
 * @author HoaDinhGiang
 */
public class MainFrame extends javax.swing.JFrame {

    /**
     * Creates new form MainFrame
     */
    private boolean loginFlag;

    public boolean isLoginFlag() {
        return loginFlag;
    }

    public void setLoginFlag(boolean loginFlag) {
        this.loginFlag = loginFlag;
    }
    
    private DangNhapInternalFrame frmDangNhap;
    private static Nhanvien _nhanVien;

    public MainFrame() {
        initComponents();
        this.loginFlag = false;
        Toolkit tk = Toolkit.getDefaultToolkit();
        Dimension screenSize = tk.getScreenSize();
        int screenHeight = screenSize.height;
        int screenWidth = screenSize.width;
        setSize(screenWidth * 3 / 4, screenHeight * 3 / 4);
        setLocation(screenWidth / 8, screenHeight / 8);
        
        setEnable(loginFlag);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuItem1 = new javax.swing.JMenuItem();
        jDesktopPane1 = new javax.swing.JDesktopPane();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem10 = new javax.swing.JMenuItem();
        jMenuItem11 = new javax.swing.JMenuItem();
        jMenuItem15 = new javax.swing.JMenuItem();
        jDesktopPane2 = new javax.swing.JDesktopPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jmHeThong = new javax.swing.JMenu();
        jmiDangNhap = new javax.swing.JMenuItem();
        jmiDangKy = new javax.swing.JMenuItem();
        jmiDoiMatKhau = new javax.swing.JMenuItem();
        jmiSaoLuu = new javax.swing.JMenuItem();
        jmiPhucHoi = new javax.swing.JMenuItem();
        jmiDangXuat = new javax.swing.JMenuItem();
        jmiThoat = new javax.swing.JMenuItem();
        jmDanhMuc = new javax.swing.JMenu();
        jmCongTy = new javax.swing.JMenu();
        jmiNhanVien = new javax.swing.JMenuItem();
        jmiBoPhan = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jmDoiTac = new javax.swing.JMenu();
        jmiNhaPhanPhoi = new javax.swing.JMenuItem();
        jmiNhaSanXuat = new javax.swing.JMenuItem();
        jmKhoHang = new javax.swing.JMenu();
        jmiKhoHang = new javax.swing.JMenuItem();
        jMenuItem7 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuItem8 = new javax.swing.JMenuItem();
        jmChucNang = new javax.swing.JMenu();
        jmQuanLyDonHang = new javax.swing.JMenu();
        jMenuItem9 = new javax.swing.JMenuItem();
        jmiXuatHang = new javax.swing.JMenuItem();
        jmiNhapHang = new javax.swing.JMenuItem();
        jmiQuanLyCuaHang = new javax.swing.JMenuItem();
        jmiKhachHang = new javax.swing.JMenuItem();
        jmiQuanLySanPham = new javax.swing.JMenuItem();
        jmiCTKhuyenMai = new javax.swing.JMenuItem();
        jMenuItem19 = new javax.swing.JMenuItem();
        jmBaoCao = new javax.swing.JMenu();
        jMenuItem14 = new javax.swing.JMenuItem();
        jMenuItem16 = new javax.swing.JMenuItem();
        jmReport = new javax.swing.JMenu();
        jmiREPORThanghoa = new javax.swing.JMenuItem();
        jmiREPORTCuagHang = new javax.swing.JMenuItem();
        jmiREPORTXuatHang = new javax.swing.JMenuItem();

        jMenuItem1.setText("jMenuItem1");

        jMenuItem4.setText("jMenuItem4");

        jMenuItem10.setText("jMenuItem10");

        jMenuItem11.setText("jMenuItem11");

        jMenuItem15.setText("jMenuItem15");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Chương Trình Quản Lý Chuỗi Cửa Hàng Điện Gia Dụng");

        jDesktopPane2.setBackground(new java.awt.Color(0, 153, 153));
        jDesktopPane2.setMinimumSize(new java.awt.Dimension(150, 300));
        getContentPane().add(jDesktopPane2, java.awt.BorderLayout.CENTER);

        jMenuBar1.setName(""); // NOI18N

        jmHeThong.setText("Hệ Thống");

        jmiDangNhap.setText("Đăng Nhập");
        jmiDangNhap.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiDangNhapActionPerformed(evt);
            }
        });
        jmHeThong.add(jmiDangNhap);

        jmiDangKy.setText("Đăng Ký");
        jmHeThong.add(jmiDangKy);

        jmiDoiMatKhau.setText("Đổi Mật Khẩu");
        jmHeThong.add(jmiDoiMatKhau);

        jmiSaoLuu.setText("Sao Lưu");
        jmHeThong.add(jmiSaoLuu);

        jmiPhucHoi.setText("Phục Hồi");
        jmiPhucHoi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiPhucHoiActionPerformed(evt);
            }
        });
        jmHeThong.add(jmiPhucHoi);

        jmiDangXuat.setText("Đăng Xuất");
        jmiDangXuat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiDangXuatActionPerformed(evt);
            }
        });
        jmHeThong.add(jmiDangXuat);

        jmiThoat.setText("Thoát");
        jmiThoat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiThoatActionPerformed(evt);
            }
        });
        jmHeThong.add(jmiThoat);

        jMenuBar1.add(jmHeThong);

        jmDanhMuc.setText("Danh Mục");
        jmDanhMuc.addMenuListener(new javax.swing.event.MenuListener() {
            public void menuDeselected(javax.swing.event.MenuEvent evt) {
            }
            public void menuCanceled(javax.swing.event.MenuEvent evt) {
            }
            public void menuSelected(javax.swing.event.MenuEvent evt) {
                jmDanhMucMenuSelected(evt);
            }
        });
        jmDanhMuc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmDanhMucActionPerformed(evt);
            }
        });

        jmCongTy.setText("Công Ty");

        jmiNhanVien.setText("Nhân Viên");
        jmiNhanVien.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiNhanVienActionPerformed(evt);
            }
        });
        jmCongTy.add(jmiNhanVien);

        jmiBoPhan.setText("Bộ Phận");
        jmCongTy.add(jmiBoPhan);

        jMenuItem3.setText("Mật Khẩu Nhân Viên");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jmCongTy.add(jMenuItem3);

        jmDanhMuc.add(jmCongTy);

        jmDoiTac.setText("Đối Tác");

        jmiNhaPhanPhoi.setText("Nhà Phân Phối");
        jmDoiTac.add(jmiNhaPhanPhoi);

        jmiNhaSanXuat.setText("Nhà Sản Xuất");
        jmDoiTac.add(jmiNhaSanXuat);

        jmDanhMuc.add(jmDoiTac);

        jmKhoHang.setText("Kho Hàng");

        jmiKhoHang.setText("Kho Hàng");
        jmiKhoHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiKhoHangActionPerformed(evt);
            }
        });
        jmKhoHang.add(jmiKhoHang);

        jMenuItem7.setText("Khu Vực");
        jmKhoHang.add(jMenuItem7);

        jMenuItem2.setText("Tỷ Giá");
        jmKhoHang.add(jMenuItem2);

        jMenuItem5.setText("Loại Hàng");
        jmKhoHang.add(jMenuItem5);

        jMenuItem8.setText("Đơn Vị Tính");
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem8ActionPerformed(evt);
            }
        });
        jmKhoHang.add(jMenuItem8);

        jmDanhMuc.add(jmKhoHang);

        jMenuBar1.add(jmDanhMuc);

        jmChucNang.setText("Chức Năng");
        jmChucNang.addMenuListener(new javax.swing.event.MenuListener() {
            public void menuDeselected(javax.swing.event.MenuEvent evt) {
            }
            public void menuCanceled(javax.swing.event.MenuEvent evt) {
            }
            public void menuSelected(javax.swing.event.MenuEvent evt) {
                jmChucNangMenuSelected(evt);
            }
        });
        jmChucNang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmChucNangActionPerformed(evt);
            }
        });

        jmQuanLyDonHang.setText("Quản Lý Bán Hàng");

        jMenuItem9.setText("Xuất Hàng Cho Khách Hàng");
        jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem9ActionPerformed(evt);
            }
        });
        jmQuanLyDonHang.add(jMenuItem9);

        jmiXuatHang.setText("Xuất Hàng Cho Cửa Hàng");
        jmiXuatHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiXuatHangActionPerformed(evt);
            }
        });
        jmQuanLyDonHang.add(jmiXuatHang);

        jmiNhapHang.setText("Nhập Hàng Cho Cửa Hàng");
        jmiNhapHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiNhapHangActionPerformed(evt);
            }
        });
        jmQuanLyDonHang.add(jmiNhapHang);

        jmChucNang.add(jmQuanLyDonHang);

        jmiQuanLyCuaHang.setText("Quản Lý Cửa Hàng");
        jmiQuanLyCuaHang.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jmiQuanLyCuaHangMouseClicked(evt);
            }
        });
        jmiQuanLyCuaHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiQuanLyCuaHangActionPerformed(evt);
            }
        });
        jmChucNang.add(jmiQuanLyCuaHang);

        jmiKhachHang.setText("Quản Lý Khách Hàng");
        jmChucNang.add(jmiKhachHang);

        jmiQuanLySanPham.setText("Quản Lý Sản Phẩm");
        jmiQuanLySanPham.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiQuanLySanPhamActionPerformed(evt);
            }
        });
        jmChucNang.add(jmiQuanLySanPham);

        jmiCTKhuyenMai.setText("Quản Lý Chương Trình Khuyến Mãi");
        jmiCTKhuyenMai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiCTKhuyenMaiActionPerformed(evt);
            }
        });
        jmChucNang.add(jmiCTKhuyenMai);

        jMenuItem19.setText("Quản Lý Hàng Tồn");
        jmChucNang.add(jMenuItem19);

        jmBaoCao.setText("Báo Cáo");

        jMenuItem14.setText("Doanh Thu");
        jMenuItem14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem14ActionPerformed(evt);
            }
        });
        jmBaoCao.add(jMenuItem14);

        jMenuItem16.setText("Hàng Tồn");
        jMenuItem16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem16ActionPerformed(evt);
            }
        });
        jmBaoCao.add(jMenuItem16);

        jmChucNang.add(jmBaoCao);

        jMenuBar1.add(jmChucNang);

        jmReport.setText("Report");

        jmiREPORThanghoa.setText("Hàng Hóa");
        jmiREPORThanghoa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiREPORThanghoaActionPerformed(evt);
            }
        });
        jmReport.add(jmiREPORThanghoa);

        jmiREPORTCuagHang.setText("Cửa Hàng");
        jmiREPORTCuagHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiREPORTCuagHangActionPerformed(evt);
            }
        });
        jmReport.add(jmiREPORTCuagHang);

        jmiREPORTXuatHang.setText("Xuất Hàng");
        jmiREPORTXuatHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiREPORTXuatHangActionPerformed(evt);
            }
        });
        jmReport.add(jmiREPORTXuatHang);

        jMenuBar1.add(jmReport);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jmiThoatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiThoatActionPerformed
        // TODO add your handling code here:
        int kq = JOptionPane.showConfirmDialog(this, "Bạn có muốn thoát không?", "Thông báo", JOptionPane.YES_NO_OPTION);
        if (kq == JOptionPane.YES_OPTION) {
            this.dispose();
        }
    }//GEN-LAST:event_jmiThoatActionPerformed

    private void jmiQuanLyCuaHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiQuanLyCuaHangActionPerformed
        QuanLyCuaHangInternalFrame frm = new QuanLyCuaHangInternalFrame();
        Component add = this.jDesktopPane2.add(frm);
        frm.setVisible(true);
    }//GEN-LAST:event_jmiQuanLyCuaHangActionPerformed

    private void jmiQuanLyCuaHangMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jmiQuanLyCuaHangMouseClicked
    }//GEN-LAST:event_jmiQuanLyCuaHangMouseClicked

    private void jmiPhucHoiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiPhucHoiActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jmiPhucHoiActionPerformed

    private void jmiQuanLySanPhamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiQuanLySanPhamActionPerformed
        // TODO add your handling code here:
        QuanLySanPhamInternalFrame frm = new QuanLySanPhamInternalFrame();
        Component add = this.jDesktopPane2.add(frm);
        try {
            frm.setMaximum(true);
        } catch (PropertyVetoException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }

        frm.setVisible(true);
    }//GEN-LAST:event_jmiQuanLySanPhamActionPerformed

    private void jmiDangNhapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiDangNhapActionPerformed
        frmDangNhap = new DangNhapInternalFrame(this);
        this.jDesktopPane2.add(frmDangNhap, BorderLayout.CENTER);
        setEnable(loginFlag);
        Dimension desktopSize = this.jDesktopPane2.getSize();
        Dimension jInternalFrameSize = frmDangNhap.getSize();
        frmDangNhap.setLocation((desktopSize.width - jInternalFrameSize.width) / 2,
                (desktopSize.height - jInternalFrameSize.height) / 2);
        frmDangNhap.setVisible(true);
        this.loginFlag = frmDangNhap.getLoginFlag();
        setEnable(loginFlag);
    }//GEN-LAST:event_jmiDangNhapActionPerformed

    private void jmDanhMucActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmDanhMucActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jmDanhMucActionPerformed

    private void setGiamDoc() {
    }

    private void setKeToan() {
    }

    private void setThuKho() {
    }

    private void setKeHoach() {
    }

    public void setEnable(boolean flag) {
        jmDanhMuc.setEnabled(flag);
        jmChucNang.setEnabled(flag);
        jmReport.setEnabled(flag);
    }
    
    private void jmDanhMucMenuSelected(javax.swing.event.MenuEvent evt) {//GEN-FIRST:event_jmDanhMucMenuSelected
        // TODO add your handling code here:
        setEnable(frmDangNhap.loginFlag);
//        if (frmDangNhap.loginFlag == true) {
//            setTrue();
//        } else {
//            setFalse();
//        }
    }//GEN-LAST:event_jmDanhMucMenuSelected

    private void jmiDangXuatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiDangXuatActionPerformed
        // TODO add your handling code here:
        setEnable(false);
        frmDangNhap.loginFlag = false;
    }//GEN-LAST:event_jmiDangXuatActionPerformed
    protected InputStream getInputStream(String reportName) {
        URL url = getClass().getResource("F:/HCDH/Lap Trinh Ung Dung JAVA/Project Giua Ky/vs1-CuaHang/quan_ly_chuoi_cua_hang_dien_gia_dung/src/gui/" + reportName);
        InputStream input = null;

        try {
            input = url.openStream();
            return input;
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, "lỗi truy cập report file", "Database Eror", JOptionPane.ERROR_MESSAGE);
            return null;
        }
    }

    private void jmiREPORTCuagHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiREPORTCuagHangActionPerformed
        // TODO add your handling code here:
        ReportFrame dtreport = new ReportFrame();
        try {
            dtreport.LoadReport("src\\report\\report1.jasper");
        } catch (SQLException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        } catch (JRException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
        jDesktopPane2.add(dtreport);
        dtreport.setVisible(true);
    }//GEN-LAST:event_jmiREPORTCuagHangActionPerformed

    private void jmiREPORTXuatHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiREPORTXuatHangActionPerformed
        // TODO add your handling code here:
        ReportFrame dtreport = new ReportFrame();
        try {
            dtreport.LoadReport("src\\report\\reportXUATHANG.jasper");
        } catch (SQLException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        } catch (JRException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
        jDesktopPane2.add(dtreport);
        dtreport.setVisible(true);
    }//GEN-LAST:event_jmiREPORTXuatHangActionPerformed

    private void jmiREPORThanghoaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiREPORThanghoaActionPerformed
        // TODO add your handling code here:
        ReportFrame dtreport = new ReportFrame();
        try {
            dtreport.LoadReport("src\\report\\quan_ly_chuoi_cua_hang_dien_gia_dung_report.jasper");
        } catch (SQLException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        } catch (JRException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
        jDesktopPane2.add(dtreport);
        dtreport.setVisible(true);
    }//GEN-LAST:event_jmiREPORThanghoaActionPerformed

    private void jmiNhanVienActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiNhanVienActionPerformed
        // TODO add your handling code here:

        QuanLyNhanVienInternalFrame frm = new QuanLyNhanVienInternalFrame();
        Component add = this.jDesktopPane2.add(frm);
        frm.setVisible(true);

    }//GEN-LAST:event_jmiNhanVienActionPerformed

    private void jmChucNangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmChucNangActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jmChucNangActionPerformed

    private void jmChucNangMenuSelected(javax.swing.event.MenuEvent evt) {//GEN-FIRST:event_jmChucNangMenuSelected
        // TODO add your handling code here:
        setEnable(frmDangNhap.loginFlag);
//        if (frmDangNhap.Test == true) {
//            setTrue();
//        } else {
//            setFalse();
//        }
    }//GEN-LAST:event_jmChucNangMenuSelected

    private void jMenuItem16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem16ActionPerformed
        // TODO add your handling code here:
        ThongKeHangTonKhoInternalFrame frm = new ThongKeHangTonKhoInternalFrame();
        Component add = this.jDesktopPane2.add(frm);
        frm.setVisible(true);
    }//GEN-LAST:event_jMenuItem16ActionPerformed

    private void jMenuItem14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem14ActionPerformed
        // TODO add your handling code here:
        ThongKeDoanhThuInternalFrame frm = new ThongKeDoanhThuInternalFrame();
        Component add = this.jDesktopPane2.add(frm);
        frm.setVisible(true);
    }//GEN-LAST:event_jMenuItem14ActionPerformed

    private void jmiXuatHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiXuatHangActionPerformed
        // TODO add your handling code here:
        PhieuXuatHangInternalFrame frm = new PhieuXuatHangInternalFrame();
        //gan Obj nhanvien vua dang nhap cho form pxh.
        frm._NhanVienPXH = new Nhanvien();
        frm._NhanVienPXH = frmDangNhap.nhanVien;
        Component add = this.jDesktopPane2.add(frm);
        frm.setVisible(true);
    }//GEN-LAST:event_jmiXuatHangActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        // TODO add your handling code here:
        QuanLyMatKhauNhanVienInternalFrame1 frm = new QuanLyMatKhauNhanVienInternalFrame1();
        Component add = this.jDesktopPane2.add(frm);
        frm.setVisible(true);
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem9ActionPerformed

    private void jmiNhapHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiNhapHangActionPerformed
        // TODO add your handling code here:
        PhieuNhapHangInternalFrame1 frm = new PhieuNhapHangInternalFrame1();
        //gan Obj nhanvien vua dang nhap cho form pxh.
//        frm._NhanVienPXH = new Nhanvien();
//        frm._NhanVienPXH = frmDangNhap.Nhanvien;
//        Component add = this.jDesktopPane2.add(frm);
        frm.setVisible(true);
    }//GEN-LAST:event_jmiNhapHangActionPerformed

    private void jmiKhoHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiKhoHangActionPerformed
        // TODO add your handling code here:
//        KhoHangInternalFrame frm = new KhoHangInternalFrame();
//        //gan Obj nhanvien vua dang nhap cho form pxh.
//        Component add = this.jDesktopPane2.add(frm);
//        frm.setVisible(true);
    }//GEN-LAST:event_jmiKhoHangActionPerformed


    private void jmiCTKhuyenMaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiCTKhuyenMaiActionPerformed
        // TODO add your handling code here:
        QuanLyCacChuongTrinhKhuyenMai form = new QuanLyCacChuongTrinhKhuyenMai();
        form.setVisible(true);
    }//GEN-LAST:event_jmiCTKhuyenMaiActionPerformed


    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
        // TODO add your handling code here:
         DonViTinhInternalFrame frm = new DonViTinhInternalFrame();
        //gan Obj nhanvien vua dang nhap cho form pxh.
        Component add = this.jDesktopPane2.add(frm);
        frm.setVisible(true);
    }//GEN-LAST:event_jMenuItem8ActionPerformed


    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new MainFrame().setVisible(true);

            }
        });

    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JDesktopPane jDesktopPane2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem11;
    private javax.swing.JMenuItem jMenuItem14;
    private javax.swing.JMenuItem jMenuItem15;
    private javax.swing.JMenuItem jMenuItem16;
    private javax.swing.JMenuItem jMenuItem19;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JMenu jmBaoCao;
    private javax.swing.JMenu jmChucNang;
    private javax.swing.JMenu jmCongTy;
    private javax.swing.JMenu jmDanhMuc;
    private javax.swing.JMenu jmDoiTac;
    private javax.swing.JMenu jmHeThong;
    private javax.swing.JMenu jmKhoHang;
    private javax.swing.JMenu jmQuanLyDonHang;
    private javax.swing.JMenu jmReport;
    private javax.swing.JMenuItem jmiBoPhan;
    private javax.swing.JMenuItem jmiCTKhuyenMai;
    private javax.swing.JMenuItem jmiDangKy;
    private javax.swing.JMenuItem jmiDangNhap;
    private javax.swing.JMenuItem jmiDangXuat;
    private javax.swing.JMenuItem jmiDoiMatKhau;
    private javax.swing.JMenuItem jmiKhachHang;
    private javax.swing.JMenuItem jmiKhoHang;
    private javax.swing.JMenuItem jmiNhaPhanPhoi;
    private javax.swing.JMenuItem jmiNhaSanXuat;
    private javax.swing.JMenuItem jmiNhanVien;
    private javax.swing.JMenuItem jmiNhapHang;
    private javax.swing.JMenuItem jmiPhucHoi;
    private javax.swing.JMenuItem jmiQuanLyCuaHang;
    private javax.swing.JMenuItem jmiQuanLySanPham;
    private javax.swing.JMenuItem jmiREPORTCuagHang;
    private javax.swing.JMenuItem jmiREPORTXuatHang;
    private javax.swing.JMenuItem jmiREPORThanghoa;
    private javax.swing.JMenuItem jmiSaoLuu;
    private javax.swing.JMenuItem jmiThoat;
    private javax.swing.JMenuItem jmiXuatHang;
    // End of variables declaration//GEN-END:variables
}
